package com.huawei123.hasee.cniao5store.di.component;

import android.app.Activity;
import android.content.Context;

import com.huawei123.hasee.cniao5store.di.module.ActivityModule;
import com.huawei123.hasee.cniao5store.di.scope.ContextLife;
import com.huawei123.hasee.cniao5store.di.scope.PerActivity;
import com.huawei123.hasee.cniao5store.mvp.view.acyivity.AppDetailActivity;
import com.huawei123.hasee.cniao5store.mvp.view.acyivity.HomeActivity;

import dagger.Component;

/**
 * 项目名称：Cniao5Store
 * 类描述：为Actvity提供的Component
 * 创建人：hasee
 * 创建时间：2017/11/9 21:02
 * 修改人：hasee
 * 修改时间：2017/11/9 21:02
 * 修改备注：注意因为需要Application的Context所以Component中需要依赖dependencies = AppComponent.class
 */
@PerActivity
@Component(modules = ActivityModule.class, dependencies = AppComponent.class)
public interface ActivityComponent {

    @ContextLife("Activity")
    Context getActivityContext();

    /**
     * 需要得到App Context，上边加上依赖dependencies = AppComponent.class
     *
     * @return
     */
    @ContextLife("Application")
    Context getApplicationContext();

    Activity getActivity();

    void inject(HomeActivity activity);

    void inject(AppDetailActivity activity);
}
